import request from '@/utils/request';
import store from '@/store'

// 取消关联接口
export function deleteCodingRuleLink(data) {
    return request({
        url: `/maintain/maintain/codingRuleRelation/cancelCodingRuleRelation/${data}`,
        method: 'put'
    })
}

// 关联接口
export function addCodingRuleLink(data) {
    const params = {
        ...data,
        createUserId: store.getters.userId,
        updateUserId: store.getters.userId
    }
    return request({
        url: '/maintain/maintain/codingRuleRelation/addCodingRuleRelation',
        method: 'put',
        data: params
    })
}

// 编辑接口
export function editCodingRuleLink(data) {
  return request({
      url: '/maintain/maintain/codingRuleRelation/editCodingRuleRelation',
      method: 'put',
      data: data
  })
}

// 编码规则列表接口
export function codingRulesList(data) {
    return request({
        url: '/maintain/maintain/codingRule/getCodingRulelist',
        method: 'get',
        params: data
    })
}

// 流水号列表
export function seriaNumberList(data) {
    return request({
        url: '/maintain/maintain/serialnumber/getSerialNumberlist',
        method: 'get',
        params: data
    })
}